home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-118.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  45.3 KB  |  1,165 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Sat, 20 Jun 92       Volume 1 : Issue 118
  2.  
  3. Today's Topics:
  4.  
  5.     Temporary ALERTS with THINK C ?
  6.     ADA and CASE for Mac
  7.     ETO only for the rich and wealthy ?
  8.     Turning on 'Scroll lock' light on EX Keyboard
  9.     Where's the volume icon?
  10.     Think C problem
  11.     Converting MPW C source to Think C source.
  12.     Creating a Dialog in ViewEdit
  13.     How do you get SuperDrive to kick into MFM mode?
  14.  
  15.  
  16. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  17.  
  18. These digests are available (by using FTP, account anonymous, your email
  19. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  20. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  21. Questions list.  The last several issues of the digest are available from
  22. sumex-aim.stanford.edu as well.
  23.  
  24. These digests are also available via email.  Just send a note saying that you
  25. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  26. automatically receive each new digest as it is created.
  27.  
  28. The digest is a collection of articles from the internet newsgroup comp.sys.
  29. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  30. and want an archive of the discussions.  If you don't know what a newsgroup
  31. is, you probably don't have access to it.  Ask your systems administrator(s)
  32. for details.  (This means you can't post questions to the digest.)
  33.  
  34. The articles in these digests are taken directly from comp.sys.mac.programmer.
  35. They are not edited; all articles included in this digest are in their original
  36. posted form.  The only articles that are -not- included in these digests are
  37. those which didn't receive any replies (except those that give information
  38. rather than ask a question).  All replies to each article are concatenated
  39. onto the original article in the order in which they were received.  Article
  40. threads are not added to the digests until the last article added to the
  41. thread is at least one month old (this is to ensure that the thread is dead
  42. before adding it to the digests).
  43.  
  44. Send administrative mail to mkelly@cs.uoregon.edu.
  45.  
  46. -------------------------------------------------------
  47.  
  48. Subject: Temporary ALERTS with THINK C ?
  49. From: jordi@sc2a.unige.ch
  50. Date: 10 May 92 14:53:24 +0200
  51. Organization: University of Geneva, Switzerland
  52.  
  53. Hi !
  54. I'm actually writing a little application to automaticaly shut down my Mac
  55. at a given time.
  56.  
  57. I write warning messages 15, 5 and 1 minutes before shutting down.
  58. The problem is that I want the warning message to appear as the very top
  59. window on screen, even if my application is running in background (Sys 7 or
  60. Multifinder).
  61.  
  62. I know I can use alerts to obtain the same result, but I don't want, because
  63. ALERTS need the user to click the OK button. I just would like to display the
  64. warning for 10 seconds and then erase it. Even if I'm working in another
  65. application such as Word...
  66.  
  67. I tried "BringToFront" but it only brings it to the front of the application
  68. process (behind the actual application window). 
  69.  
  70. So:
  71. 1) How can I display a window at the very top without using ALERTS ?
  72. 2) If alerts must be used, is there a way to make them temporary whithout
  73.    requiring the user intervention ?
  74.  
  75.  
  76. Thanks for any help !
  77.  
  78. Sincerely,
  79.  
  80. Steve Jordi                
  81.  
  82. +-------------------------+----------------------------------------------+
  83. | Dpt of Geophysics       | Fax: + 41 22 320-5732                        |
  84. | University of Geneva    |                                              |
  85. | 13, Rue des Maraichers  | E-Mail: Internet:   jordi@sc2a.unige.ch      |
  86. | 1211 GENEVA 4           |         Bitnet:     jordi@cgeuge52.bitnet    |
  87. | Switzerland             |         Compuserve: 70143,3056 (once a week) |
  88. +-------------------------+----------------------------------------------+ 
  89.  
  90.  
  91. +++++++++++++++++++++++++++
  92.  
  93. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  94. Date: 14 May 92 04:41:40 GMT
  95. Organization: Royal Institute of Technology, Stockholm, Sweden
  96.  
  97. .unige.ch> jordi@sc2a.unige.ch writes:
  98.  
  99.    The problem is that I want the warning message to appear as the very top
  100.    window on screen, even if my application is running in background (Sys 7 or
  101.    Multifinder).
  102.  
  103. To switch layers, test for the process manager using Gestalt.
  104. IF it's implemented, do a GetCurrentProcess and SetFrontProcess
  105. (OOH! NASTY ! You could also use AEInteractWithUser, even if
  106. you're not processing an apple event)
  107. IF IT'S NOT implemented, do a OpenDeskAcc ( CurApName ) which is a
  108. skanky hack that doesn=t work under 7.0 but does under 6.x
  109.  
  110.    I tried "BringToFront" but it only brings it to the front of the application
  111.    process (behind the actual application window). 
  112.  
  113. You should use SelectWindow for that...
  114. - -- 
  115. h++ - new and improved !
  116.  
  117. "It's simple. Some people have braces in their names, and some don't. You'll
  118.    just have to accept it the way it is." - Me: h+@nada.kth.se; Jon W{tte
  119.  
  120. +++++++++++++++++++++++++++
  121.  
  122. From: dorner@pequod.cso.uiuc.edu (Steve Dorner)
  123. Date: 14 May 92 18:19:01 GMT
  124. Organization: University of Illinois at Urbana-Champaign
  125.  
  126. d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
  127. >To switch layers, test for the process manager using Gestalt.
  128. >IF it's implemented, do a GetCurrentProcess and SetFrontProcess
  129.  
  130. I've had considerable trouble with the Gestalt and the Process Manager
  131. under A/UX 2.0.  Namely, Gestalt indicates it's available, but calls
  132. to it crash.  So you have extra work to do if you want to be A/UX 2.0
  133. compatible.
  134. - -- 
  135. Steve Dorner, U of Illinois Computing Services Office
  136. Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner
  137.  
  138. +++++++++++++++++++++++++++
  139.  
  140. From: ksand@apple.com (Kent Sandvik)
  141. Date: 18 May 92 19:38:46 GMT
  142. Organization: MacDTS Mongols
  143.  
  144. In article <1992May14.181901.28888@news.cso.uiuc.edu>,
  145. dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
  146. > d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
  147. > >To switch layers, test for the process manager using Gestalt.
  148. > >IF it's implemented, do a GetCurrentProcess and SetFrontProcess
  149.  
  150. > I've had considerable trouble with the Gestalt and the Process Manager
  151. > under A/UX 2.0.  Namely, Gestalt indicates it's available, but calls
  152. > to it crash.  So you have extra work to do if you want to be A/UX 2.0
  153. > compatible.
  154.  
  155. That has to be a bug, the Process Manager is part of System 7, and those
  156. features were rolled into A/UX in the 3.0 release.
  157.  
  158. Cheers,
  159. kent
  160.  
  161. ---------------------------
  162.  
  163. From: t33853s@saha.hut.fi (Esa Eero Eklund)
  164. Subject: ADA and CASE for Mac
  165. Date: 12 May 92 08:47:07 GMT
  166. Organization: Helsinki University of Technology, Finland
  167.  
  168.  
  169.   I'm looking for ADA development system for Mac, possibly combined
  170. with complete CASE environment, especially HOOD based CASE would be jam.
  171. Do you have any recommendations?
  172.  
  173.   Howabout ALSYS ADA and MERIDAN ADA? Can they be integrated in MPW? And
  174. where could I get some info on those products? What is your experience
  175. on these products?
  176.  
  177.   Mighty thanks in advance!
  178.  
  179.  
  180. Esa E Eklund 007E       !  Good morning, Dr. Chandra. 
  181. eklund@niksula.hut.fi   !  This is Seagate ST277N.
  182. ISU '90 student         !  I am ready for my first block test.
  183.                         !  And the man cried.
  184.  
  185. +++++++++++++++++++++++++++
  186.  
  187. From: Thad.Humphries@p950.f70.n109.z1.fidonet.org (Thad Humphries)
  188. Date: 13 May 92 01:55:42 GMT
  189.  
  190.  
  191.   EE> From: t33853s@saha.hut.fi (Esa Eero Eklund) Newsgroups:
  192.   EE> comp.sys.mac.programmer Organization: Helsinki University of
  193.   EE> Technology, Finland
  194.   EE> 
  195.   EE> I'm looking for ADA development system for Mac, possibly combined with
  196.   EE> complete CASE environment, especially HOOD based CASE would be jam. Do
  197.   EE> you have any recommendations?
  198.   EE> 
  199.   EE> Howabout ALSYS ADA and MERIDAN ADA? Can they be integrated in MPW? And
  200.   EE> where could I get some info on those products? What is your experience
  201.   EE> on these
  202.   EE> products?
  203.  
  204. This should be a FAQ 'cause I've answered it several times.  Here goes:
  205.  
  206. Only TeleSoft's Ada and Meridian's Ada run under the MacOS.  Both require MPW. 
  207. Alsys is for A/UX.  TeleSoft's product is $895 and I have not used it.  Meridian
  208. is $495 ($149 students).  It's interfaces are about System 6.0.5 era with no
  209. plans to support 7.  It's validated under MPW 3.0 but they will ship 3.2 if you
  210. need it.  It does not support SADE and the Meridian debugger won't link with the
  211. Mac libraries -- it is command line only, for text stuff in MPW.  Like all MPW
  212. (and Ada) it is slow -- 80+ seconds to compile and link "hello world" on a IIci.
  213.  Also, Meridian says you can't TASK with Quickdraw "because of a bug/features in
  214. Quickdraw concerning its assumption about the placement of the stack pointer." 
  215. I haven't tried yet but plan to play with this soon.  Meridian tech support has
  216. not responded to my messages on this issue, or when/if they will upgrade to
  217. System 7.
  218.  
  219. I have written some Mac stuff in Ada, typical menu & window stuff plus off
  220. screen bit maps, async sound.  Due to Ada's strict typing, it is agony.
  221.  
  222. Recommendation:  If you really need Ada on the Mac, think again and go for THINK
  223. C or MPW C++.  If forced by a contract, by TeleSoft as it *has* to be better
  224. (one would hope!).  If it is just for school, get Meridian at the $149 price and
  225. sell it to someone when you graduate.
  226.  
  227. +++++++++++++++++++++++++++
  228.  
  229. From: bhanafee@deimos.ads.com (Brian Hanafee)
  230. Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
  231. Date: Fri, 15 May 1992 02:02:06 GMT
  232.  
  233.  
  234. In article <1992May12.084707.23259@nntp.hut.fi> t33853s@saha.hut.fi (Esa Eero Eklund) writes:
  235. >  Howabout ALSYS ADA and MERIDAN ADA? Can they be integrated in MPW? And
  236. >where could I get some info on those products? What is your experience
  237. >on these products?
  238.  
  239. I don't know about Alsys Ada.  Meridian Ada does run under MPW; in
  240. fact it both requires and comes with MPW.  I don't have enough
  241. experience with it yet to comment.
  242.  
  243. Meridian Software Systems, Inc.
  244. 10 Pasteur St.
  245. Irvine, CA 92718
  246.  
  247. (800) 221-2522
  248. (714) 727-0700
  249. Fax: (714) 727-3583
  250.  
  251. You may also be interested to know that Meridian was recently aquired
  252. by another major player in the Ada market, Verdix.
  253.  
  254. - --
  255. Brian Hanafee                         Advanced Decision Systems
  256. bhanafee@ads.com                      1500 Plymouth Street
  257. (415) 960-7300                        Mountain View, CA 94043-1230
  258.  
  259. +++++++++++++++++++++++++++
  260.  
  261. From: garym@telesoft.com (Gary Morris @lone)
  262. Date: 19 May 92 23:39:43 GMT
  263. Organization: TeleSoft, San Diego, CA, USA
  264.  
  265. In <705762032.F00001@blkcat.UUCP> Thad.Humphries@p950.f70.n109.z1.fidonet.org (Thad Humphries) writes:
  266.  
  267. >  EE> From: t33853s@saha.hut.fi (Esa Eero Eklund) Newsgroups:
  268. >  EE> 
  269. >  EE> I'm looking for ADA development system for Mac, possibly combined with
  270. >  EE> complete CASE environment, especially HOOD based CASE would be jam. Do
  271. >  EE> you have any recommendations?
  272.  
  273. >Only TeleSoft's Ada and Meridian's Ada run under the MacOS.  Both require MPW. 
  274. >Alsys is for A/UX.  TeleSoft's product is $895 and I have not used it.  
  275.  
  276. TeleSoft's Ada for the Macintosh only runs under AUX, not the MacOS.   And 
  277. thus, it doesn't work with MPW.  If you want to know more contact us.
  278.  
  279. - --GaryM
  280. - -- 
  281. Gary Morris                     Internet: garym@telesoft.com
  282. Ada Software Development        UUCP:     uunet!telesoft!garym
  283. TeleSoft, San Diego, CA         Phone:    +1 619-457-2700
  284.  
  285. ---------------------------
  286.  
  287. From: hp48sx@wuarchive.wustl.edu (HP48SX Archive Maintainer)
  288. Subject: ETO only for the rich and wealthy ?
  289. Date: 16 May 92 14:26:49 GMT
  290. Organization: Washington University in Saint Louis, Missouri USA
  291.  
  292. Hi,
  293. I just got the new APDA catalog today, and I can see that they have
  294. increased the price of ETO from $995 to $1295. I really hate this,
  295. I was saving to upgrade my MPE C bvundle & C++ to the full E.T.O., and
  296. now this very high change in price.  They still got a 1 month special
  297. offer, $995 for the complete package, but then I can't get any credits
  298. for mu old packages.  I almost had the  money to buy it. And now this.
  299.  
  300. I guess I will buy one of the 3rd party C++ libraries instead. Quite a
  301. few is currently being ported.
  302.  
  303. There is no reason why Apple should increase the price that much. the
  304. 30% price increase is equal toabout 20 years of price increases here
  305. :-(.
  306. - --
  307. Povl H. Pedersen             hp48sx@wuarchive.wustl.edu
  308. HP48sx archive maintainer
  309.  
  310. All Opinions (C) Copyright the Integalactic Thought Association
  311.  
  312. +++++++++++++++++++++++++++
  313.  
  314. From: nagle@netcom.com (John Nagle)
  315. Date: Sat, 16 May 92 18:32:22 GMT
  316. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  317.  
  318. hp48sx@wuarchive.wustl.edu (HP48SX Archive Maintainer) writes:
  319.  
  320. >Hi,
  321. >I just got the new APDA catalog today, and I can see that they have
  322. >increased the price of ETO from $995 to $1295. I really hate this,
  323. >I was saving to upgrade my MPE C bvundle & C++ to the full E.T.O., and
  324. >now this very high change in price.  They still got a 1 month special
  325. >offer, $995 for the complete package, but then I can't get any credits
  326. >for mu old packages.  I almost had the  money to buy it. And now this.
  327.  
  328.         I expect that a full set of development tools will cost $10,000 to
  329. $20,000 by the year 2000.  This is consistent with the consolidation in
  330. the software industry.  One vendor (Microsoft) has a quarter of the market.
  331. Three vendors have half.  Eleven vendors have three-quarters.  Everybody
  332. else is fighting it out for the remaining quarter.  The industry is 
  333. now dominated by the battle for shelf space in retail outlets, just like,
  334. say, laundry detergents.
  335.  
  336.         The evangelism era is over.
  337.  
  338.                     John Nagle
  339.  
  340. +++++++++++++++++++++++++++
  341.  
  342. From: ksand@apple.com (Kent Sandvik)
  343. Date: 18 May 92 19:37:24 GMT
  344. Organization: MacDTS Mongols
  345.  
  346. In article <t0qktxd.nagle@netcom.com>, nagle@netcom.com (John Nagle) writes:
  347.  
  348. >         I expect that a full set of development tools will cost $10,000 to
  349. > $20,000 by the year 2000.  This is consistent with the consolidation in
  350. > the software industry.  One vendor (Microsoft) has a quarter of the market.
  351. > Three vendors have half.  Eleven vendors have three-quarters.  Everybody
  352. > else is fighting it out for the remaining quarter.  The industry is 
  353. > now dominated by the battle for shelf space in retail outlets, just like,
  354. > say, laundry detergents.
  355.  
  356. >         The evangelism era is over.
  357.  
  358. Actually, I don't think this is the case. Any small development tools vendors,
  359. which could produce an incremental compiler/linker system, or even better,
  360. a dynamic object language environment, will certainly have a nice market window.
  361.  
  362. This because more and more developers realize that the big sellers of future
  363. will be extremely complex applications, with constraints handling, 
  364. ai-type user interaction, and in general we need to glue together fairly 
  365. complex libraries.
  366.  
  367. Another trend is back to the document model applications, where the end user
  368. starts with a document, and uses tools for producing the final result (original
  369. Lisa idea, and the current Works/ClarisWorks trend).
  370.  
  371. Whoever produces development environments, where even non-star-programmers
  372. could create interesting applications, will certainly have a nice market. I'm
  373. not talking about Visual Basic and similar half-crappy attempts :-).
  374.  
  375. My vision is that it should be as easy to piece together an interesting
  376. application as to jam on a guitar. The guitar has 24 frets and 6 strings,
  377. but anyone with a musical talent will learn to play it within a month.
  378.  
  379. Cheers,
  380. Kent
  381. PS: Private comments.
  382.  
  383. ---------------------------
  384.  
  385. From: efisch@cs.utexas.edu (Eric A. Fisch)
  386. Subject: Turning on 'Scroll lock' light on EX Keyboard
  387. Date: 17 May 1992 09:28:23 -0500
  388. Organization: U Texas Dept of Computer Sciences, Austin TX
  389.  
  390. I am interested in being able to illuminate the scroll lock light
  391. on an Extended keyboard. I will be using THINK C. Is it also
  392. possible to illuminate the num lock nd cpas lock lights without 
  393. the user pressing their appropriate keys??
  394.  
  395. regards,
  396. Eric Fisch
  397. efisch@cs.utexas.edu
  398.  
  399.  
  400.  
  401. +++++++++++++++++++++++++++
  402.  
  403. From: jpugh@apple.com (Jon Pugh)
  404. Date: 18 May 92 00:39:39 GMT
  405. Organization: Apple Computer, Inc.
  406.  
  407. In article <l1crc7INNmeh@priddy.cs.utexas.edu>, efisch@cs.utexas.edu (Eric A. Fisch) writes:
  408. > I am interested in being able to illuminate the scroll lock light
  409. > on an Extended keyboard. I will be using THINK C. Is it also
  410. > possible to illuminate the num lock nd cpas lock lights without 
  411. > the user pressing their appropriate keys??
  412.  
  413. Check out the LED snippet in the snippets directory of ftp.apple.com or on
  414. the Developer CDs.
  415.  
  416. You can do everything you want.  You just have to code it.  ;)
  417.  
  418. Jon
  419.  
  420. ---------------------------
  421.  
  422. From: babin@csc.ti.com
  423. Subject: Where's the volume icon?
  424. Date: 15 May 92 15:47:55 GMT
  425. Organization: Texas Instruments
  426.  
  427. Given the vRefNum for a volume, I need to find and copy the icon (ICN# and
  428. ics#) for the volume.  Where is this information stored?  I've looked through
  429. IM IV and VI and poked around with ResEdit, but haven't had any luck.  Any
  430. pointers on where to look?
  431.  
  432. Thanks,
  433. Mike Babin
  434. Texas Instruments
  435. babin@csc.ti.com 
  436.  
  437. +++++++++++++++++++++++++++
  438.  
  439. From: wysocki@husc.harvard.edu (Chris Wysocki)
  440. Date: 15 May 92 17:26:02 GMT
  441. Organization: Harvard University, Cambridge, MA
  442.  
  443. In article <1992May15.154755.19236@csc.ti.com>, babin@csc.ti.com writes:
  444. > Given the vRefNum for a volume, I need to find and copy the icon (ICN# and
  445. > ics#) for the volume.  Where is this information stored?  I've looked through
  446. > IM IV and VI and poked around with ResEdit, but haven't had any luck.  Any
  447. > pointers on where to look?
  448.  
  449. You need to make a Control call to the disk driver to get the volume icon:
  450.  
  451.     Handle          iconH;
  452.     HParamBlockRec  hpb;
  453.     ParamBlockRec   pb;
  454.     
  455.     hpb.volumeParam.ioNamePtr = NULL;
  456.     hpb.volumeParam.ioVRefNum = vRefNum;
  457.     hpb.volumeParam.ioVolIndex = 0;
  458.     FailOSErr(PBHGetVInfoSync(&hpb));
  459.     
  460.     pb.cntrlParam.ioVRefNum = hpb.volumeParam.ioVDrvInfo;
  461.     pb.cntrlParam.ioCRefNum = hpb.volumeParam.ioVDRefNum;
  462.     pb.cntrlParam.csCode = 21;
  463.     if (PBControlSync(&pb) == noErr)
  464.         FailOSErr(PtrToHand(*(Ptr *) pb.cntrlParam.csParam, &iconH, kLargeIconSize));
  465.  
  466. See IM IV-224 and V-470 for all the details.  As far as I know, there's no
  467. way to get a small icon for a volume; you can only shrink down the large
  468. icon.
  469.  
  470. Chris Wysocki
  471. wysocki@husc.harvard.edu
  472.  
  473. +++++++++++++++++++++++++++
  474.  
  475. From: stevec@Apple.COM (Steve Christensen)
  476. Date: 19 May 92 01:54:15 GMT
  477. Organization: Apple Computer Inc., Cupertino, CA
  478.  
  479. babin@csc.ti.com writes:
  480.  
  481. >Given the vRefNum for a volume, I need to find and copy the icon (ICN# and
  482. >ics#) for the volume.  Where is this information stored?  I've looked through
  483. >IM IV and VI and poked around with ResEdit, but haven't had any luck.  Any
  484. >pointers on where to look?
  485.  
  486. Yep, it's in the driver for the disk the volume resides on.  Here's what to
  487. do:
  488.  
  489. Ptr GetVolumeIcon(short theVRefNum) {
  490. HVolumeParam    vpb;
  491. CntrlParam    cpb;
  492. long        *diskIcon;
  493.  
  494. vpb.ioNamePtr = nil;                // don't care about the name
  495. vpb.ioVRefNum = theVRefNum;            // which volume
  496. vpb.ioVolIndex = 0;                // just use vRefNum
  497. if (! PBHGetVInfo((HParmBlkPtr) &vpb, false)) {
  498.     cpb.ioVRefNum = vpb.ioVDrvInfo;        // drive number
  499.     cpb.ioCRefNum = vpb.ioVDRefNum;        // driver refNum
  500.     cpb.csCode = 22;            // "return media icon"
  501.     if (! PBControl((ParmBlkPtr) &cpb, false)) {
  502.         diskIcon = &cpb.csParam;    // a little type coercion
  503.         return((Ptr) *diskIcon);    // return pointer to icon
  504.     }
  505. }
  506. return(0);                    // error: return nil pointer
  507. };
  508.  
  509. This will return the disk icon (i.e., a little floppy disk).  If you want
  510. the drive icon (i.e., shows a Mac with an arrow pointing to the drive),
  511. change the csCode value to 21.  The returned pointer will point to a structure
  512. that has the same format as an ICN# resource (32 longs of icon data, followed
  513. by 32 longs of icon mask).
  514.  
  515. steve
  516. - -- 
  517. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  518.   Steve Christensen            Never hit a man with glasses.
  519.   stevec@apple.com            Hit him with a baseball bat.
  520.  
  521. ---------------------------
  522.  
  523. From: jafl@cco.caltech.edu (John Lindal)
  524. Subject: Think C problem
  525. Date: 13 May 92 17:04:42 GMT
  526. Organization: California Institute of Technology, Pasadena
  527.  
  528. I am working with the Think C compiler and am having some problems.
  529. I would appreciate if anyone could solve the following question:
  530.  
  531. I create a class (CThing1, say) that is a descendant of CObject.
  532. Then I create a subclass of CThing1 (CThing2, say).
  533.  
  534. To initialize a new CThing2 object, I call its initialization routine.
  535. This routine first calls CThing1's init and then changes a couple of
  536. instance variables to fit CThing2.  The code looks like:
  537.  
  538. void CThing2::IThing2(void)
  539. {
  540.   inherited::IThing1(void);
  541.  
  542.   var1=[a new value]; var2=[a new value];
  543. }
  544.  
  545. What actually happens, however, is that another variable (var3) ALSO gets
  546. changed, even though IThing1() set it correctly.
  547.  
  548. That is:  I print out the values of var1,var2,var3 immediately after calling
  549. IThing1() and they are correct.  I print out the values of var1,var2,var3
  550. immediately after setting var1 and var2 AND ALL 3 HAVE CHANGED!!
  551.  
  552.  
  553. Thanks for any help or suggestions.  John Lindal
  554.  
  555. +++++++++++++++++++++++++++
  556.  
  557. From: zobkiw@world.std.com (Joe Zobkiw)
  558. Date: 14 May 92 15:08:06 GMT
  559. Organization: The World Public Access UNIX, Brookline, MA
  560.  
  561. John -
  562.  
  563. You may want to step through your code with the THINK C Debugger and see
  564. exactly when var3 is being changed. This might help to shed some light on
  565. your problem.
  566.  
  567. - -- 
  568. - -- joe zobkiw                             Internet: zobkiw@world.std.com
  569. - --                                             AOL: AFL Zobkiw  
  570. - -- mac.synthesis.MIDI.THINK C.OOP.asm          CI$: 70712,515 
  571. - -- communications.networks.cool tunes...
  572.  
  573. +++++++++++++++++++++++++++
  574.  
  575. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  576. Date: 16 May 92 22:05:58 GMT
  577.  
  578. I just spent some time tracking down a bug that sounds related to this.
  579. Basically, some instance variables were getting trounced that weren't
  580. even touched by the method.  I finally buggered the culprit by
  581. checksumming the problem variables with TMON.
  582.  
  583. The moral--always pass a long integer to StringToNum.  And, don't forget
  584. how powerful checksum can be.
  585.  
  586.     - Scott
  587.  
  588. +++++++++++++++++++++++++++
  589.  
  590. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  591. Date: 17 May 92 11:20:36 GMT
  592. Organization: Royal Institute of Technology, Stockholm, Sweden
  593.  
  594. @mcl.mcl.ucsb.edu (Scott Bronson) writes:
  595.  
  596.    I just spent some time tracking down a bug that sounds related to this.
  597.    Basically, some instance variables were getting trounced that weren't
  598.    even touched by the method.  I finally buggered the culprit by
  599.    checksumming the problem variables with TMON.
  600.  
  601.    The moral--always pass a long integer to StringToNum.  And, don't forget
  602.    how powerful checksum can be.
  603.  
  604. No, here's the moral:
  605.  
  606.     Always have Strict Prototyping
  607.     Always re-compile MacHeaders with SimplifyPrototypes 0
  608.  
  609. or
  610.  
  611.     Always compile with max warnings, and care about them !
  612.  
  613. - -- 
  614. h++ - new and improved !
  615.  
  616. "It's simple. Some people have braces in their names, and some don't. You'll
  617.    just have to accept it the way it is." - Me: h+@nada.kth.se; Jon W{tte
  618.  
  619. +++++++++++++++++++++++++++
  620.  
  621. From: jafl@cco.caltech.edu (John Lindal)
  622. Date: 18 May 92 22:05:15 GMT
  623. Organization: California Institute of Technology, Pasadena
  624.  
  625. Well, the moral to my story (original post) is that dimensioning an array
  626. as long array[4] allows me to only access array[0] to array[3].
  627.  
  628. Thanks to those who responded.  John Lindal
  629.  
  630. +++++++++++++++++++++++++++
  631.  
  632. From: ksand@apple.com (Kent Sandvik)
  633. Date: 17 May 92 22:44:12 GMT
  634. Organization: MacDTS Mongols
  635.  
  636. In article <D88-JWA.92May17122036@byse.nada.kth.se>, d88-jwa@byse.nada.kth.se
  637. (Jon W{tte) writes:
  638. >     Always have Strict Prototyping
  639. >     Always re-compile MacHeaders with SimplifyPrototypes 0
  640.  
  641. Yes, that was one of the things I also learned during the DTS debugging
  642. lab sessions, weird problems disappeared with strict prototype checking
  643. turned on, so missing header files were flagged for insertion. This should be
  644. the 
  645. default setting in Think C, IMHO.
  646.  
  647. > "It's simple. Some people have braces in their names, and some don't. You'll
  648. >    just have to accept it the way it is." - Me: h+@nada.kth.se; Jon W{tte
  649.  
  650. I would like to thank my grand-grand-grand-father who settled by a lake bay with
  651. a lot of sand and took a surname which didn't have any braces in ASCII-7
  652. (Sandvik), 
  653. same with my mother and father who avoided any Swedish first names with braces.
  654.  
  655. Cheers,
  656. Kent
  657.  
  658. ---------------------------
  659.  
  660. From: f85-tno@nada.kth.se (Tommy Nordgren)
  661. Subject: Converting MPW C source to Think C source.
  662. Date: 17 May 92 14:45:13 GMT
  663. Organization: Royal Institute of Technology, Stockholm, Sweden
  664.  
  665. any hints on how to convert the code so it can be compiled under Think C.
  666.     Tommy Nordgren.
  667.  
  668. +++++++++++++++++++++++++++
  669.  
  670. From: steve@oceania.com (Steve Dakin)
  671. Date: 18 May 92 17:48:26 GMT
  672. Organization: Oceania Health Care Systems
  673.  
  674. In article <1992May17.144513.15329@kth.se> f85-tno@nada.kth.se (Tommy Nordgren)  
  675. writes:
  676. > any hints on how to convert the code so it can be compiled under Think C.
  677. >     Tommy Nordgren.
  678.  
  679. I use both MPW C and THINK C but haven't done any extensive converting from one  
  680. to the other.  I know that THINK's object stuff is not compatible with MPW  
  681. (yeah, I know, that was a tough one).  As for going from MPW to THINK - as far  
  682. as I know, the latest version of each uses the same header files (a big step in  
  683. the right direction), so that part should be relatively painless.  As for  
  684. inconsistencies, the only one I know of is the way quickdraw globals are  
  685. handled.  In THINK, you just use the global variable as is, in MPW, you must  
  686. put 'qd.' in front of it.  For example, accessing the current port looks like:
  687.  
  688. In THINK:  thePort...
  689. In MPW:    qd.thePort...
  690.  
  691. Anyone else know of other differences?
  692.  
  693. Steve
  694. - -- 
  695.     Steve Dakin                        Oceania Health Care Systems 
  696.  steve@oceania.com (NeXT mail)         Palo Alto, CA (415) 322-0127
  697.  jester@oceania.com
  698.  
  699. +++++++++++++++++++++++++++
  700.  
  701. From: drc@claris.com (Dennis Cohen)
  702. Date: 19 May 92 14:01:45 GMT
  703. Organization: Claris Corporation, Santa Clara CA
  704.  
  705. steve@oceania.com (Steve Dakin) writes:
  706.  
  707. >In article <1992May17.144513.15329@kth.se> f85-tno@nada.kth.se (Tommy Nordgren)  
  708. >writes:
  709. >> any hints on how to convert the code so it can be compiled under Think C.
  710. >>     Tommy Nordgren.
  711.  
  712. >I use both MPW C and THINK C but haven't done any extensive converting from one  
  713. >to the other.  I know that THINK's object stuff is not compatible with MPW  
  714. >(yeah, I know, that was a tough one).  As for going from MPW to THINK - as far  
  715. >as I know, the latest version of each uses the same header files (a big step in  
  716. >the right direction), so that part should be relatively painless.  As for  
  717. >inconsistencies, the only one I know of is the way quickdraw globals are  
  718. >handled.  In THINK, you just use the global variable as is, in MPW, you must  
  719. >put 'qd.' in front of it.  For example, accessing the current port looks like:
  720.  
  721. >In THINK:  thePort...
  722. >In MPW:    qd.thePort...
  723.  
  724. >Anyone else know of other differences?
  725.  
  726. In THINK, integers are 16 bit unless otherwise set in preferences, in MPW they
  727. are always 32-bit.  This also makes a difference in how things are pushed
  728. on the stack.  Alignment within structs can also be different.  Any other
  729. differences tend to fall into the arena of OO extensions.
  730.  
  731. - -- 
  732. Dennis Cohen
  733. Claris Corp.
  734.  ****************************************************
  735. Disclaimer:  Any opinions expressed above are _MINE_!
  736.  
  737. +++++++++++++++++++++++++++
  738.  
  739. From: potts@itl.itd.umich.edu (Paul Potts)
  740. Date: 19 May 92 17:40:25 GMT
  741. Organization: Instructional Technology Laboratory, University of Michigan
  742.  
  743. In article <1992May18.174826.25485@oceania.com> steve@oceania.com writes:
  744. >In article <1992May17.144513.15329@kth.se> f85-tno@nada.kth.se (Tommy Nordgren)  
  745. >writes:
  746. >> any hints on how to convert the code so it can be compiled under Think C.
  747. >>     Tommy Nordgren.
  748. >
  749. >I use both MPW C and THINK C but haven't done any extensive converting from one  
  750. >to the other.  I know that THINK's object stuff is not compatible with MPW  
  751. >(yeah, I know, that was a tough one).  As for going from MPW to THINK - as far  
  752. >as I know, the latest version of each uses the same header files (a big step in  
  753. >the right direction), so that part should be relatively painless.  
  754.  
  755. I've had great success converting recent code easily from one to the other
  756. with no modifications. THINK has greatly improved compatibility and 99.99%
  757. of our code required no modifications.
  758.  
  759. The only difference that we found is that THINK is an ANSI compiler and
  760. MPW isn't, or, at least it doesn't complain about some ANSI violations.
  761. The one construct that caused problems was a use of the question-mark
  762. operator that needed to be parenthesized differently. If you are writing
  763. ANSI C under MPW that shouldn't be an issue.
  764.  
  765.  
  766. - -- 
  767. "breakpoints" _See_also_ debugging, watch expressions; "debugging breakpoints"
  768.  _See_ breakpoints; "debugging watch expressions" _See_ watch expressions;
  769. "watch expressions" _See_also_ debugging... (Borland C++ manual index)
  770. Paul R. Potts, Software Designer --- potts@itl.itd.umich.edu <--- me!
  771.  
  772. ---------------------------
  773.  
  774. From: gray@tinman.asel.udel.edu (John Gray)
  775. Subject: Creating a Dialog in ViewEdit
  776. Organization: AI duPont Inst.
  777. Date: Thu, 30 Apr 1992 18:49:17 GMT
  778.  
  779. I'm fairly new to the Mac and MacApp and I am having problems creating
  780. a simple modal dialog box using ViewEdit to create the view template.
  781.  
  782. The dialog is simple. It has a label, a field to enter a number, a Ok button
  783. and a Cancel button.  When I run the thing I get a labels (not even
  784. the OK and Cancel labels in the buttons).  Clicking on with button highlights
  785. the button but does nothing else.  Clicking in the number field crashes
  786. the Mac.  At this point I would be happy to starting a dialog with just
  787. the button which works correctly (With labels and functionality).
  788.  
  789. I have been through the manuals to no avail.  I have successful created the
  790. main view for the application as indicated in the MapApp C++ Tutorial.
  791.  
  792. I am using code from DialogDemos demo from MacApp 3.0 to bring up the dialog.
  793.  
  794.     FailNIL(aWindow = gViewServer->NewTemplateWindow((short)kThresDLogId, NULL));
  795.     dismisser = aWindow->PoseModally();
  796.     if (dismisser == 'ok  ')
  797.         n = ((TNumberText *)(aWindow->FindSubView('numb')))->GetValue();
  798.     else
  799.         n = 0;
  800.     aWindow->Close();
  801.  
  802. Any suggestions?
  803.  
  804. Thanks
  805. John Gray
  806. gray@asel.udel.edu
  807.  
  808. +++++++++++++++++++++++++++
  809.  
  810. From: suwa@skunk.nri.co.jp (Shigeo Suwa)
  811. Date: 1 May 92 05:15:03 GMT
  812. Organization: Nomura Research Institute, Ltd.
  813.  
  814. In article <1992Apr30.184917.15240@udel.edu> gray@tinman.asel.udel.edu (John Gray) writes:
  815.  
  816. >The dialog is simple. It has a label, a field to enter a number, a Ok button
  817. >and a Cancel button.  When I run the thing I get a labels (not even
  818. >the OK and Cancel labels in the buttons).  Clicking on with button highlights
  819. >the button but does nothing else.  Clicking in the number field crashes
  820. >the Mac.  At this point I would be happy to starting a dialog with just
  821. >the button which works correctly (With labels and functionality).
  822. >
  823. >Any suggestions?
  824.  
  825. Did you include "Dialog.rsrc" in your own "YourApp.r" file?
  826.  
  827. If you didn't make your own "YourApp.r" file, the default one (located
  828. "...MacApp 3.0:Interfaces:RIncludes:Default.r") is used.  In "Default.r",
  829. the include statement for "Dialog.rsrc" is commented out.
  830.  
  831. You must make your own "YourApp.r" and include "Dialog.rsrc".
  832.  
  833. - -- 
  834. Shigeo Suwa (suwa@nri.co.jp)
  835. MIX:ssuwa   CompuServe:74100,350   NIFTY:PBA00350
  836.  
  837. +++++++++++++++++++++++++++
  838.  
  839. From: ksand@apple.com (Kent Sandvik)
  840. Date: 17 May 92 23:00:43 GMT
  841. Organization: MacDTS Mongols
  842.  
  843. In article <15691@skunk.nri.co.jp>, suwa@skunk.nri.co.jp (Shigeo Suwa) writes:
  844. > In article <1992Apr30.184917.15240@udel.edu> gray@tinman.asel.udel.edu (John
  845. Gray) writes:
  846. > >The dialog is simple. It has a label, a field to enter a number, a Ok button
  847. > >and a Cancel button.  When I run the thing I get a labels (not even
  848. > >the OK and Cancel labels in the buttons).  Clicking on with button highlights
  849. > >the button but does nothing else.  Clicking in the number field crashes
  850. > >the Mac.  At this point I would be happy to starting a dialog with just
  851. > >the button which works correctly (With labels and functionality).
  852. > >
  853. > >Any suggestions?
  854. > Did you include "Dialog.rsrc" in your own "YourApp.r" file?
  855. > If you didn't make your own "YourApp.r" file, the default one (located
  856. > "...MacApp 3.0:Interfaces:RIncludes:Default.r") is used.  In "Default.r",
  857. > the include statement for "Dialog.rsrc" is commented out.
  858. > You must make your own "YourApp.r" and include "Dialog.rsrc".
  859.  
  860. The only sore thing with this trick is that Rez can't resolve resources
  861. with the same ID, something which happens if you use the same resource
  862. editor for creation of different .rsrc files. For instance STR 
  863. resource IDs usually start from the same ID base, and by inclusion of
  864. various .rsrc you get nice errors. This is the reason I usually operate
  865. with only one .rsrc file.
  866.  
  867. BTW, at the latest BAMADA meeting a new View editor was shown, called AdLib.
  868. It handles MacApp 3.0 Views, adorners, behaviors, drawing environments,
  869. the window/view is always in run mode, and you just add and change elements
  870. as in a drawing package. The application was done by a consultant who wanted
  871. to learn MacApp (I guess it shows the level of training programs one could do
  872. in an object framework :-)). Stay tune for more information abou this really
  873. nice product.
  874.  
  875. Cheers,
  876. Kent
  877.  
  878. ---------------------------
  879.  
  880. From: swb1_ltd@uhura.cc.rochester.edu (Steve Berkley)
  881. Subject: How do you get SuperDrive to kick into MFM mode?
  882. Date: 24 Apr 92 19:31:02 GMT
  883. Organization: University of Rochester - Rochester, New York
  884.  
  885. In the continuing epic to get a simple disk imaging program going,
  886. I need one last, *vital* piece of information: What do I do to get
  887. the disk driver to kick into MFM mode on the SuperDrive?  Also,
  888. how can I test for presence of the SuperDrive?  I'm using PBRead
  889. to read direct sectors off the disk, and need to read sectors 0-9
  890. off the diskette (like an IBM disk), not the usual 8-12 sectors
  891. scheme used on 800K and 400K floppies...
  892.  
  893. Any hints, tips, would be appreciated.  Or references to tech-notes
  894. that discuss this.
  895.  
  896. Thanks in advance,
  897. Steve Berkley
  898. swb1_ltd@uhura.cc.rochester.edu
  899.  
  900. +++++++++++++++++++++++++++
  901.  
  902. From: stevec@Apple.COM (Steve Christensen)
  903. Date: 5 May 92 01:51:16 GMT
  904. Organization: Apple Computer Inc., Cupertino, CA
  905.  
  906. swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
  907.  
  908. >In the continuing epic to get a simple disk imaging program going,
  909. >I need one last, *vital* piece of information: What do I do to get
  910. >the disk driver to kick into MFM mode on the SuperDrive?  Also,
  911. >how can I test for presence of the SuperDrive?  I'm using PBRead
  912. >to read direct sectors off the disk, and need to read sectors 0-9
  913. >off the diskette (like an IBM disk), not the usual 8-12 sectors
  914. >scheme used on 800K and 400K floppies...
  915.  
  916. The floppy disk driver will switch the drive into MFM mode ONLY when it sees
  917. an MFM disk in the drive (for non-HD disks), or if an HD disk is currently
  918. inserted.  There is no programatic way to force it into that mode.
  919.  
  920. As far as testing for the presence of a SuperDrive, this is probably not
  921. what you really need to do.  I assume you just want to know what kind of
  922. disk you've got.  You can find this out by making a Format List status call
  923. (csCode=6) to the driver and looking up the current format...
  924.  
  925. steve
  926.  
  927. - -- 
  928. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  929.   Steve Christensen            Never hit a man with glasses.
  930.   stevec@apple.com            Hit him with a baseball bat.
  931.  
  932. +++++++++++++++++++++++++++
  933.  
  934. From: t.g.finstad@fys.uio.no (Terje Finstad)
  935. Date: 7 May 92 15:48:56 GMT
  936. Organization: Dept. Physics
  937.  
  938. In article <66573@apple.Apple.COM>, stevec@Apple.COM (Steve Christensen) writes:
  939. > swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
  940. > >In the continuing epic to get a simple disk imaging program going,
  941. > >I need one last, *vital* piece of information: What do I do to get
  942. > >the disk driver to kick into MFM mode on the SuperDrive?  Also,
  943. > >how can I test for presence of the SuperDrive?  I'm using PBRead
  944. > >to read direct sectors off the disk, and need to read sectors 0-9
  945. > >off the diskette (like an IBM disk), not the usual 8-12 sectors
  946. > >scheme used on 800K and 400K floppies...
  947. >
  948. When I try the same thing ( not necessarily exactly the same way, but )
  949. I can read sector 1 to 9 ( as on IBM ) even though the diskette is formatted 
  950. with ten sectors pr track. The .sony driver always skips sector 0 (zero)
  951. This means every tenth block will be inacessible. The .sony driver thinks he 
  952. is shewing on a MS-DOS formatted 720 K MFM diskette. As stated by mr.
  953. Christensen: 
  954. > The floppy disk driver will switch the drive into MFM mode ONLY when it sees
  955. > an MFM disk in the drive (for non-HD disks), or if an HD disk is currently
  956. > inserted.  There is no programatic way to force it into that mode.
  957. "no programmatic way"  hm.. ...under *normal circumstances? or always?. 
  958. Thinking aload: does this also mean that the driver uses fixed 
  959. hardcoded parameters in ROM to a large extent. I think that by pulling the
  960. diskette driver aport-code wise-, you may find a way for it to handle
  961. 800 K MFM diskettes, since you are "so close".
  962. In the process you may also find an effective way of shredding (spelling ?)
  963. MS-DOS or other diskettes.
  964. Mr. Christensen's statement above seems to imply that there is  no way one 
  965. can format a 720 K diskette on the SuperDrive, and therefore definitely not
  966. a 800 K MFM diskettes.  That may be.  I have no reasons to not believe him.
  967. His statement is not exactly as I interpreteded it either.  
  968. Well I'm building up to stating something I hope will not be taken in a
  969. negative way. I can see many reasons for discouraging floppy drive hacking...
  970. many to protect the hackers but also those that might use nonstandard floppy
  971. manipulation as part of their copy protection scheme.       
  972. But when you read his signature, you must think he is nice guy that is not 
  973. too worried. 
  974. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  975. >   Steve Christensen            Never hit a man with glasses.
  976. >   stevec@apple.com            Hit him with a baseball bat.
  977. >
  978. Is there any else 'out there' that can help shredding Steve Berkley's
  979. diskettes?  There must be some people that have worked on this sort of thing.
  980. Written articles about how to defeat copy protection schemes etc.?
  981.  
  982. ( I have understood that Steve Berkley's project is not about this )
  983.  
  984. ( those with the knowledge and paranoic fear for their diskette artistery
  985.   could  give the guy a patch to put in some driver hooks,
  986.   it's very unlikely these could be used for anything "harmful", 
  987.   It is more dangerous that he and others have to first understand how
  988.   to defeat copyprotection, to be able to do a presumably simple task 
  989.   of setting the number of sectors pr. track, with or without the .sony
  990. )
  991.  
  992. Sincerely Terje
  993.  
  994. ===========t.g.finstad@fys.uio.no======================================
  995.  
  996.  
  997. +++++++++++++++++++++++++++
  998.  
  999. From: russotto@eng.umd.edu (Matthew T. Russotto)
  1000. Date: Thu, 07 May 92 17:44:35 GMT
  1001. Organization: College of Engineering, University of Maryland, College Park
  1002.  
  1003. In article <1992May7.154856.17734@ulrik.uio.no> t.g.finstad@fys.uio.no (Terje Finstad) writes:
  1004.  
  1005. >When I try the same thing ( not necessarily exactly the same way, but )
  1006. >I can read sector 1 to 9 ( as on IBM ) even though the diskette is formatted 
  1007. >with ten sectors pr track. The .sony driver always skips sector 0 (zero)
  1008. >This means every tenth block will be inacessible. The .sony driver thinks he 
  1009. >is shewing on a MS-DOS formatted 720 K MFM diskette. As stated by mr.
  1010.  
  1011. >I think that by pulling the diskette driver aport-code wise-, you may
  1012. >find a way for it to handle
  1013. >800 K MFM diskettes, since you are "so close".
  1014.  
  1015. This seems likely.  What I would guess is happening is that at some
  1016. level, the Sony driver has either a table or a method of calculating
  1017. track and sector from the block number.  Find this table/calculation,
  1018. modify it, and you are in business.
  1019.  
  1020. >Mr. Christensen's statement above seems to imply that there is  no way one 
  1021. >can format a 720 K diskette on the SuperDrive
  1022. Not so, you can tell the .Sony driver to format a disk as 720K
  1023. MS-DOS-- you just can't force it to _read_ an arbitrary disk as MFM
  1024. rather than GCR.  But it sounds like that, at the lowest level, the
  1025. .Sony driver is already doing the right thing.
  1026.  
  1027. >Is there any else 'out there' that can help shredding Steve Berkley's
  1028. >diskettes?  There must be some people that have worked on this sort of thing.
  1029. >Written articles about how to defeat copy protection schemes etc.?
  1030.  
  1031. I remember this sort of fun from my Apple II days...
  1032.  
  1033. - -- 
  1034. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  1035. Some news readers expect "Disclaimer:" here.
  1036. Just say NO to police searches and seizures.  Make them use force.
  1037. (not responsible for bodily harm resulting from following above advice)
  1038.  
  1039. +++++++++++++++++++++++++++
  1040.  
  1041. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1042. Date: 8 May 92 19:01:03 +1200
  1043. Organization: University of Waikato, Hamilton, New Zealand
  1044.  
  1045. In article <1992May7.154856.17734@ulrik.uio.no>, t.g.finstad@fys.uio.no (Terje Finstad) writes:
  1046. > Mr. Christensen's statement above seems to imply that there is  no way one
  1047. > can format a 720 K diskette on the SuperDrive, and therefore definitely not
  1048. > a 800 K MFM diskettes.
  1049.  
  1050. Remember that Apple File Exchange and DOS Mounter *will* let you create 720K
  1051. MFM DOS-format disks. I have even created a 720K MFM Mac-format disk, just
  1052. to satisfy myself it could be done. The Disk Initialization package does
  1053. a Status call to the disk driver to get the list of available formats
  1054. (based on the fact that there's a DD disk in the drive, rather than an HD
  1055. disk); it then does a Control call to choose one of these. I just intercepted
  1056. the Control call with MacsBug, and changed the index that it passed.
  1057.  
  1058. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1059. Computer Services Dept                     fax: +64-7-838-4066
  1060. University of Waikato            electric mail: ldo@waikato.ac.nz
  1061. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1062.  
  1063. +++++++++++++++++++++++++++
  1064.  
  1065. From: stevec@Apple.COM (Steve Christensen)
  1066. Date: 19 May 92 00:49:11 GMT
  1067. Organization: Apple Computer Inc., Cupertino, CA
  1068.  
  1069. t.g.finstad@fys.uio.no (Terje Finstad) writes:
  1070.  
  1071. >"no programmatic way"  hm.. ...under *normal circumstances? or always?. 
  1072. >Thinking aload: does this also mean that the driver uses fixed 
  1073. >hardcoded parameters in ROM to a large extent. I think that by pulling the
  1074. >diskette driver aport-code wise-, you may find a way for it to handle
  1075. >800 K MFM diskettes, since you are "so close".
  1076. >In the process you may also find an effective way of shredding (spelling ?)
  1077. >MS-DOS or other diskettes.
  1078.  
  1079. No, there is no programmatic way.  It may be possible to call into the middle
  1080. of the driver to get a bits and pieces, but that will typically involve
  1081. jumping into the middle of the ROM, and thus needing to keep track of the
  1082. ROM addresses of the appropriate routines.  Note that this will not work
  1083. in the case of the IIfx and Quadra 900 (because they use a separate processor 
  1084. to run the SWIM chip and disk drives), or on portable Macs because of power
  1085. management issues.  Also, as floppy technologies progress, I would expect
  1086. Apple to use new chips and/or drives that aren't necessarily based on the
  1087. current batch of hardware, so anything that plays around that low-level
  1088. would stop working, crash, etc.
  1089.  
  1090. >Mr. Christensen's statement above seems to imply that there is  no way one 
  1091. >can format a 720 K diskette on the SuperDrive, and therefore definitely not
  1092. >a 800 K MFM diskettes.  That may be.  I have no reasons to not believe him.
  1093.  
  1094. Not at all.  You can format any of the 4 supported disk formats (400K, 800K,
  1095. 720K, 1440K) solely with driver calls as long as the appropriate disk
  1096. controller, drive, and media are there.  Tech Note #273 (I believe) goes into
  1097. detail on the floppy driver's control and status calls.  Making a "return
  1098. format list" call will list the current and possible formats for a particular
  1099. drive, then passing the format number (1..n) to the format call will format
  1100. the disk correctly.
  1101.  
  1102. But you're right about not being able to format an 800K _MFM_ disk.  That's
  1103. not one of the formats the floppy driver knows about.
  1104.  
  1105. steve
  1106. - -- 
  1107. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1108.   Steve Christensen            Never hit a man with glasses.
  1109.   stevec@apple.com            Hit him with a baseball bat.
  1110.  
  1111. +++++++++++++++++++++++++++
  1112.  
  1113. From: stevec@Apple.COM (Steve Christensen)
  1114. Date: 19 May 92 01:04:21 GMT
  1115. Organization: Apple Computer Inc., Cupertino, CA
  1116.  
  1117. russotto@eng.umd.edu (Matthew T. Russotto) writes:
  1118. t.g.finstad@fys.uio.no (Terje Finstad) writes:
  1119. >>I think that by pulling the diskette driver aport-code wise-, you may
  1120. >>find a way for it to handle 800 K MFM diskettes, since you are "so close".
  1121.  
  1122. >This seems likely.  What I would guess is happening is that at some
  1123. >level, the Sony driver has either a table or a method of calculating
  1124. >track and sector from the block number.  Find this table/calculation,
  1125. >modify it, and you are in business.
  1126.  
  1127. The Sony driver does a block number to track/side/sector calculation, but
  1128. the calculation is not table-driven, and is hard-coded to the 4 formats
  1129. supported by the driver.  Also, that particular routine is not vectored,
  1130. so short of replacing a good chunk of the driver, it's tough to get to.
  1131.  
  1132. >>Mr. Christensen's statement above seems to imply that there is  no way one 
  1133. >>can format a 720 K diskette on the SuperDrive
  1134. >Not so, you can tell the .Sony driver to format a disk as 720K
  1135. >MS-DOS-- you just can't force it to _read_ an arbitrary disk as MFM
  1136. >rather than GCR.  But it sounds like that, at the lowest level, the
  1137. >.Sony driver is already doing the right thing.
  1138.  
  1139. [putting on my Apple hat] Hacking the floppy driver is a big no-no.  It won't
  1140. work on all Macs (differing hardware), and may crash on new Macs if they use
  1141. non-SWIM based hardware.  Bad! Bad! Bad!  [taking off my Apple hat]
  1142.  
  1143. steve
  1144. - -- 
  1145. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1146.   Steve Christensen            Never hit a man with glasses.
  1147.   stevec@apple.com            Hit him with a baseball bat.
  1148.  
  1149. ---------------------------
  1150.  
  1151. End of C.S.M.P. Digest
  1152. **********************
  1153.